<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    
</head>
<body>
    <script>
        //关键字方式
        function demo(){
            console.log("demo,关键字方式");
        }
        demo();

        //表达式方式
        var test = function(){
            console.log("test,表达式方式");
        }
        test();


        var test1 = function(m,n){
            console.log(m+n);
        }
        test1("hello","JS");

        //Function 构造函数方式
        var fun = new Function('console.log("fun,构造函数方式")');
        fun();

        var fun1 = new Function('m','n','console.log(m+":"+n)');
        fun1('name','tom');

    </script>
    
</body>
</html>